public class LeetCode278 {

    public int firstBadVersion(int n) {
        int left = 1, right = n;
        while (left < right) {
            int mid = left + (right - left) / 2;
//            if (isBadVersion(mid)){
//                right = mid;
//            }else {
//                left = mid + 1;
//            }
            // left == right 为第一个错误版本
        }
        return right;
    }

}
